Page({
    data: {
     cities:"",
     hotCities:"",
     msg:[]
     
    },
  onLoad:function (){
    
    wx.request({
        url:`http://47.108.197.28:8000/city`,     
        method: 'GET',
        success: (res)=>{
          console.log(res.data.data)        
          var hotCities=res.data.data.hotCities;
          var cities=res.data.data.cities;        
          this.setData({
            hotCities,
            cities
          })
        }
        
    });
    
  },
  onSearch(e){
    var msg=this.data.msg;
    console.log(e.detail);
    var value=e.detail
    msg.unshift(value)
    this.setData({msg})
  },
  handleCity(event){
      console.log(event)
    var {aid} = event.currentTarget.dataset;
    wx.setStorageSync("city", aid);
    wx.navigateBack();
}
  })